package com.chenfan.mcn.model.vo;

import com.chenfan.mcn.enums.ArchivingStatusEnum;
import com.chenfan.mcn.enums.StarRebateStatusEnum;
import com.chenfan.mcn.model.StarBillingHeader;
import com.chenfan.mcn.model.StarRebateContract;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Objects;

/**
 * 红人返点合同详情
 *
 * @author wulg
 * @date 2021-11-17
 **/
@EqualsAndHashCode(callSuper = true)
@Data
public class StarRebateContractDetailVO extends StarRebateContract {

    /**
     * 创建人部门
     */
    private String departmentName;

    /**
     * 开票抬头
     */
    private StarBillingHeader billingDetails;

    /**
     * 红人昵称
     */
    private String starNickname;

    /**
     * 我司合同签约主体
     */
    private String companyContractSubject;

    /**
     * 当前审批流程ID
     */
    private Long flowId;

    /**
     * 审批流程ID集合-含撤回等
     */
    private String flowIds;

    /**
     * 审批节点名称
     */
    private String flowStatusName;

    /**
     * 单据状态名称
     */
    private String approvalStatusName;

    /**
     * 归档状态名称
     */
    private String archivingStatusName;

    /**
     * 执行单
     */
    private List<StarRebateExcutionOrderVO> excutionOrders;

    /**
     * 年框合同
     */
    private YearFrameContractVO yearFrameContractVO;


    public String getApprovalStatusName() {
        if (Objects.nonNull(getApprovalStatus())) {
            return StarRebateStatusEnum.getStatusName(getApprovalStatus());
        }
        return null;
    }

    public String getArchivingStatusName() {
        if (Objects.nonNull(getArchivingStatus())) {
            return ArchivingStatusEnum.getStatusName(getArchivingStatus());
        }
        return null;
    }

}
